package org.example.aienglishapp_login.dto.login;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public class UserLoginDTO {

    @NotBlank(message = "用户名或手机号码不能为空")
    @Size(max = 20, message = "用户名不能超过20个字符")
    private String usernameOrPhone;

    @NotBlank(message = "密码不能为空")
    @Size(min = 8, message = "密码必须至少8位")
    private String userpassword;

    // Getter 和 Setter
    public String getUsernameOrPhone() {
        return usernameOrPhone;
    }

    public void setUsernameOrPhone(String usernameOrPhone) {
        this.usernameOrPhone = usernameOrPhone;
    }

    public String getUserpassword() {
        return userpassword;
    }

    public void setUserpassword(String userPassword) {
        this.userpassword = userPassword;
    }

    // toString() 方法
    @Override
    public String toString() {
        return "UserLoginDTO{" +
                "usernameOrPhone='" + usernameOrPhone + '\'' +
                ", userpassword='" + userpassword + '\'' +
                '}';
    }
}